package com.ssn.jse.io;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;

public class PictureCopy {
	public static void main(String[] args) {
		File f=new File("d:/a.jpg");
		File f2=new File("e:/a.jpg");
		int n=0;
		FileInputStream fi=null;
		FileOutputStream fo=null;
		try {
			fi=new FileInputStream(f);
			fo=new FileOutputStream(f2);
			byte[] b=new byte[512];
			while((n=fi.read(b))!=-1){
				fo.write(b);
			}
		
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{
			try {
				fi.close();
				fo.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
		}
	}
}
